// https://nuxt.com/docs/api/configuration/nuxt-config
import postcssConfig from "./utils/postcssConfig"
export default defineNuxtConfig({
  compatibilityDate: '2024-04-03',
  devtools: { enabled: true },
  devServer: {
    port: 8090,
    host: "", //默认值:localhost
    https: false, //是否开启https
    url: "http://localhost:8090", //监听url
  },
  sourcemap: {
    //是否生成 sourcemaps。
    server: true,
    client: false,
  },
  ssr: true, //是否启用 HTML 呈现 - 动态（在服务器模式下）或在生成时。如果设置为目标false并与目标结合static，生成的页面将只显示一个没有内容的加载屏幕
  app:{
    head:{
      title: '新盛合环保',
      titleTemplate: '%s - 新盛合环保',//%s 替换页面标题
      charset: 'utf-8',
      htmlAttrs: {
        lang: 'zh-cn',
      },
      meta: [
        { name: 'viewport', content: 'width=device-width, initial-scale=1' },
        { name: 'keywords', content: '玻璃钢化粪池,玻璃钢管道,玻璃钢冷却塔,玻璃钢电缆管,一体化提升泵站,玻璃钢冷却塔,格栅,警示牌,标志桩,风机,拉挤型材,玻璃钢夹砂管厂家电话，总经理：周爱友，电话：18999931669' },
        { name: 'description', content: '新盛合环保设备-玻璃钢化粪池-玻璃钢管道-玻璃钢冷却塔-玻璃钢电缆管-一体化提升泵站-玻璃钢冷却塔-格栅-警示牌-标志桩-风机-拉挤型材-玻璃钢百科站点' },
      ],
      link: [ //全局样式
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
        // { rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/npm/element-plus/dist/index.css' },
      ],
      script: [ //cdns cript
        // {
        //   src: 'https://www.googletagmanager.com/gtag/js?id=G-JXQZVQJZJL',
        //   async: true,
        // },
        // {
        //   src: '/js/gtag.js',
        //   async: true,
        // },
      ],
    }
  },
  modules:['@element-plus/nuxt','@nuxtjs/i18n','nuxt-swiper'],
  imports: {
    dirs: ['api'],//'composables', 'utils'
  },
  elementPlus: {
    importStyle: 'scss',
  },
  swiper: {
    // Swiper options
    // See https://swiperjs.com/swiper-api
    // swiperOptions: {
    //   // swiper options
    // },
    // modules: [Navigation, Pagination],
    // modulesFiles: ['navigation', 'pagination'],
  },
  css:['@/assets/fonts/iconfont.css','@/assets/fonts/text/fangzhen.css','@/assets/css/index.scss','@/assets/css/common.scss'],
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "@/assets/css/element-variables.scss" as element;`,//@use "@/assets/css/index.scss" as *;@use "@/assets/css/common.scss" as *;
        },
      },
    },
  },
  postcss:postcssConfig,
  i18n: {
    strategy: 'prefix_and_default',  // 添加路由前缀no_prefix
    locales: ["en","zh"],            // 配置语种
    defaultLocale: 'zh',             // 默认语种
    vueI18n: './language/i18n.ts',     // 通过vueI18n配置
  },
  
})
